<form name="frmProxy" ng-init="dvm.init()" ng-submit="dvm.save(frmProxy.$valid)" novalidate>
  <div class="modal-header">
    <button type="button" class="close" ng-click="dvm.close()">&times;</button>
    <h4 class="modal-title">代理路由配置</h4>
  </div>
  <div class="modal-body">
    <div class="form-group">
      <div class="input-group">
        <span class="input-group-addon">代理端口：</span>
        <input type="number" class="form-control" min="{{dvm.proxyPortRange[0]}}" max="{{dvm.proxyPortRange[1]}}"
            name="port" ng-model="dvm.proxyPort" ng-readonly="sessionUser.role != 'admin'" required autofocus
            placeholder="{{'(' + dvm.proxyPortRange[0] + '..' + dvm.proxyPortRange[1] + ')'}}"
            ng-class="{'x-invalid': frmProxy.$submitted && frmProxy.port.$invalid}">
      </div>
      <p class="text-danger" ng-show="frmProxy.$submitted && frmProxy.port.$error.required">代理端口不能为空</p>
    </div>
    <div form-table form-type="'form'" form-inputs="dvm.proxyRoutes"
        form-label="{'key': '代理路由', 'value': '目标路由'}" form-placeholder="{'key': '', 'value': ''}"></div>
  </div>
  <div class="modal-footer">
    <button type="submit" ng-if="sessionUser.role == 'admin'" class="btn btn-default"
        ng-disabled="frmProxy.$invalid"><i class="fa fa-save"></i> 保存</button>
    <button type="button" class="btn btn-default" ng-click="dvm.refresh()">
      <i class="fa fa-refresh"></i> 刷新</button>
    <button type="button" class="btn btn-default" ng-click="dvm.close()">
      <i class="fa fa-times"></i> 关闭</button>
  </div>
</form>
